//
//  ZYPayTool.m
//  ziyun
//
//  Created by ziyun on 16/9/5.
//  Copyright © 2016年 zy. All rights reserved.
//

#import "ZYPayTool.h"
//#import <AlipaySDK/AlipaySDK.h>
//#import "WXApi.h"
//#import "UPPaymentControl.h"

@implementation ZYPayTool

+ (void)ZYPay:(kPayType)payType payInfo:(id)payInfo completionBlock:(void (^)(BOOL isBool))completionBlock VC:(UIViewController *)viewController
{
    /*
    switch (payType) {
        case kPayTypeAli:
        {
            [[AlipaySDK defaultService]payOrder:payInfo fromScheme:CBAppDescription callback:^(NSDictionary *resultDic) {
                
                switch ([[resultDic objectForKey:@"resultStatus"] intValue]) {
                    case 9000://成功
                    {
                        if (completionBlock) {
                            completionBlock(YES);
                        }
                        return ;
                    }
                        break;
                    case 6001://取消
                    {
                        if (completionBlock) {
                            completionBlock(NO);
                        }
                        [SCTool showError:@"用户取消支付宝交易"];
                    }
                        break;
                    case 6002:
                    {
                        if (completionBlock) {
                            completionBlock(NO);
                        }
                        [SCTool showError:@"网络连接错误"];
                    }
                        break;
                    case 4000:
                    {
                        if (completionBlock) {
                            completionBlock(NO);
                        }
                        [SCTool showError:@"订单支付失败"];
                    }
                        break;
                    case 8000:
                    {
                        if (completionBlock) {
                            completionBlock(NO);
                        }
                        [SCTool showError:@"订单正在处理中"];
                    }
                    default:
                        break;
                }
                
            }];


            
        
        }
            break;
            case kPayTypeWx:
        {
            PayReq* req             = [[PayReq alloc] init];
            req.openID              = [payInfo objectForKey:@"appid"];
            req.partnerId           = [payInfo objectForKey:@"partnerid"];
            req.prepayId            = [payInfo objectForKey:@"prepayid"];
            req.nonceStr            = [payInfo objectForKey:@"noncestr"];
            req.timeStamp           = [[payInfo objectForKey:@"timestamp"] intValue];
            req.package             = [payInfo objectForKey:@"package"];
            req.sign                = [payInfo objectForKey:@"sign"];
            [WXApi sendReq:req];
        
        
        }
            break;
            
            case kPayTypeCb:
        {
//            [[UPPaymentControl defaultControl] startPay:payInfo  fromScheme:KZYAppDescription mode:kUPayMode viewController:viewController];
            
        }
            break;
            
            
            
        default:
            break;
    }

*/
}


@end
